package com.cangxuan.manage.controller;

import com.cangxuan.manage.annotation.Check;
import com.cangxuan.manage.entity.Admin;
import com.cangxuan.manage.service.IAdminService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

@Api(tags = "其它接口")
@Slf4j
@RestController
public class IndexController extends BaseController {

    IAdminService adminService;
    @Autowired
    public void setAdminService(IAdminService adminService) {
        this.adminService = adminService;
    }

    @PostMapping("login")
    @ApiOperation("管理员登录")
    public Object login(@Check @RequestBody Admin admin) throws InterruptedException {
        Thread.sleep(2000);
        String sign = adminService.login(admin);
        return success("登录成功",sign);
    }

}
